feat: support compile main-thread script to bytecode in external bundle#2459
feat: support compile main-thread script to bytecode in external bundle#2459
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🦋 Changeset detectedLatest commit: a2b7429 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughCollects main-thread entry chunk names during bundler setup, passes them to ExternalBundleWebpackPlugin via a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/rspeedy/lynx-bundle-rslib-config/src/webpack/ExternalBundleWebpackPlugin.ts`:
- Around line 138-142: The check in ExternalBundleWebpackPlugin that uses
this.options.mainThreadChunks?.includes(cur.name) compares against the emitted
asset filename (cur.name) which can include hashes/dirs; change it to compare
normalized chunk/section identity: derive a stable name (e.g., use
cur.chunk?.name or extract a basename/normalized section name from cur.name) and
compare that against a normalized version of this.options.mainThreadChunks (map
the configured names through the same normalization). Update the condition to
use the normalizedChunkName (instead of cur.name) so the JsBytecode branch is
chosen by chunk identity, not the raw emitted filename.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4c307d79-ebf4-4bb5-932b-8792c7227ca4
📒 Files selected for processing (5)
.changeset/flat-bikes-boil.mdpackages/rspeedy/lynx-bundle-rslib-config/etc/lynx-bundle-rslib-config.api.mdpackages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.tspackages/rspeedy/lynx-bundle-rslib-config/src/webpack/ExternalBundleWebpackPlugin.tspackages/rspeedy/lynx-bundle-rslib-config/test/external-bundle.test.ts
Merging this PR will degrade performance by 19.63%
Performance Changes
Comparing Footnotes
|
React Example#7487 Bundle Size — 224.41KiB (0%).a2b7429(current) vs 25b09e9 main#7486(baseline) Bundle metrics
|
| Current #7487 |
Baseline #7486 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
179 |
179 |
|
69 |
69 |
|
44.51% |
44.51% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #7487 |
Baseline #7486 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
78.65KiB |
78.65KiB |
Bundle analysis report Branch feat/external-bundle-mts-bytecod... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#9061 Bundle Size — 898.15KiB (-0.06%).a2b7429(current) vs 25b09e9 main#9060(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch feat/external-bundle-mts-bytecod... Project dashboard Generated by RelativeCI Documentation Report issue |
React External#605 Bundle Size — 674.83KiB (+15.7%).a2b7429(current) vs 25b09e9 main#604(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch feat/external-bundle-mts-bytecod... Project dashboard Generated by RelativeCI Documentation Report issue |
React MTF Example#620 Bundle Size — 195.57KiB (0%).a2b7429(current) vs 25b09e9 main#619(baseline) Bundle metrics
|
| Current #620 |
Baseline #619 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
173 |
173 |
|
66 |
66 |
|
44% |
44% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #620 |
Baseline #619 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
84.34KiB |
84.34KiB |
Bundle analysis report Branch feat/external-bundle-mts-bytecod... Project dashboard
Generated by RelativeCI Documentation Report issue
6364902 to
98c0fa6
Compare
Summary by CodeRabbit
New Features
Tests
Chores
Checklist